package com.mnemonic.domain;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * 难度
 * 
 * @author lifeng
 * @date 2021/05/12
 */
@XmlRootElement
public class Level implements Cloneable, StorageAble {

    private static final long serialVersionUID = 1L;

    private String id;
    private String name; // 名称
    private Integer row; // 行
    private Integer col; // 列
    private Integer mine;// 雷数
    private Integer boutOps;// 每回合可操作的次数，没有区分左键或右键（限定总数） 1
    private Integer boutTimeOut;// 每回合的秒数 -1 不限制

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getRow() {
        return row;
    }

    public void setRow(Integer row) {
        this.row = row;
    }

    public Integer getCol() {
        return col;
    }

    public void setCol(Integer col) {
        this.col = col;
    }

    public Integer getMine() {
        return mine;
    }

    public void setMine(Integer mine) {
        this.mine = mine;
    }

    public Integer getBoutOps() {
        return boutOps;
    }

    public void setBoutOps(Integer boutOps) {
        this.boutOps = boutOps;
    }

    public Integer getBoutTimeOut() {
        return boutTimeOut;
    }

    public void setBoutTimeOut(Integer boutTimeOut) {
        this.boutTimeOut = boutTimeOut;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.name).append(" 雷区：").append(this.row).append("X").append(this.col).append(", 雷数:")
            .append(this.mine).append(", 每回合可操作的次数：").append(this.boutOps).append(", 每回合限制秒数：")
            .append((this.boutTimeOut == null || this.boutTimeOut == -1) ? "不限制" : this.boutTimeOut + "秒");
        return sb.toString();
    }

    @Override
    public Level clone() throws CloneNotSupportedException {
        return (Level)super.clone();
    }
}
